#include <iostream>
using namespace std;

//交换
void swap1(int &a, int &b){
	int temp = a;
	a = b;
	b = temp;
}

void swap2(int *p, int *q){
	int temp = *p;
	*p = *q;
	*q = temp;
}

int main(){
	int x = 5, y = 10;
	cout << "交换前" << "x=" << x << "y=" << y << endl;
	swap1(x, y);
	cout << "交换后" << "x=" << x << "y=" << y << endl;
		
	return 0; 
}